﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ParameterSaveRoUpdateForm.aspx.cs"
    Inherits="OMSWeb.Admin.Systems.ParameterSaveRoUpdateForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../../lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="../../lib/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
    <link href="../../css/SystemsManage.css" rel="stylesheet" type="text/css" />
    

    <script src="../../lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>

    <script src="../../lib/ligerUI/js/core/base.js" type="text/javascript"></script>

    <script src="../../lib/ligerUI/js/plugins/ligerForm.js" type="text/javascript"></script>

    <script src="../../lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>

    <script src="../../lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>

    <script src="../../lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>

    <script src="../../lib/ligerUI/js/plugins/ligerButton.js" type="text/javascript"></script>

    <script src="../../lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>

    <script src="../../lib/ligerUI/js/plugins/ligerRadio.js" type="text/javascript"></script>

    <script src="../../lib/ligerUI/js/plugins/ligerSpinner.js" type="text/javascript"></script>

    <script src="../../lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>

    <script src="../../lib/ligerUI/js/plugins/ligerTip.js" type="text/javascript"></script>

    <script src="../../lib/jquery-validation/jquery.validate.min.js" type="text/javascript"></script>

    <script src="../../lib/jquery-validation/jquery.metadata.js" type="text/javascript"></script>

    <script src="../../lib/jquery-validation/messages_cn.js" type="text/javascript"></script>

    <script type="text/javascript">
        var eee;
        $(function() {
            $.metadata.setType("attr", "validate");
            var v = $("form").validate({
                debug: true,
                errorPlacement: function(lable, element) {
                    if (element.hasClass("l-textarea")) {
                        element.ligerTip({ content: lable.html(), target: element[0] });
                    }
                    else if (element.hasClass("l-text-field")) {
                        element.parent().ligerTip({ content: lable.html(), target: element[0] });
                    }
                    else {
                        lable.appendTo(element.parents("td:first").next("td"));
                    }
                },
                success: function(lable) {
                    lable.ligerHideTip();
                    lable.remove();
                },
                submitHandler: function() {
                    $("form .l-text,.l-textarea").ligerHideTip();
                    //alert("Submitted!")
                    var param = { Id: $("#txtId").val(),
                        TypeName: $("#txtTypeName").val(),
                        Name: $("#txtName").val(),
                        Value: $("#txtValue").val()
                    };
                    //alert(param);
                    alert(JSON.stringify(param));
                    //ale

                    $.ajax({

                        type: "POST",
                        contentType: "application/json",
                        url: "ParameterSaveRoUpdateForm.aspx",
                        data: JSON.stringify(param), //传送数组               
                        dataType: "json",
                        success: function(result) {
                            alert('添加成功')
                        },
                        error: function(e) {
                            alert(e.responseText)
                        }

                    });



                }
            });
            $("form").ligerForm();
            $(".l-button-test").click(function() {
                alert(v.element($("#txtName")));
            });
        });  
    </script>
</head>
<body style="padding: 10px">
    <form name="form1" runat="server" id="form1">
    <div>
    </div>
    <table cellpadding="0" cellspacing="0" class="l-table-edit">
        <tr>
            <td align="right" class="l-table-edit-td">
                参数类型:
            </td>
            <td align="left" class="l-table-edit-td">
                <input name="txtTypeName" type="text" id="txtTypeName" ltype="text" validate="{required:true,minlength:3,maxlength:10}" />
            </td>
            <td align="left">
            </td>
        </tr>
        <tr>
            <td align="right" class="l-table-edit-td">
                参数名称:
            </td>
            <td align="left" class="l-table-edit-td">
                <input name="txtName" type="text" id="txtName" ltype="text" validate="{required:true,minlength:3,maxlength:49}" />
            </td>
            <td align="left">
            </td>
        </tr>
        <tr>
            <td align="right" class="l-table-edit-td">
                参数值:
            </td>
            <td align="left" class="l-table-edit-td">
                <input name="txtValue" type="text" id="txtValue" ltype="text" validate="{required:true,minlength:3,maxlength:50}" />
            </td>
            <td align="left">
            </td>
        </tr>
    </table>
    <br />
    <input type="submit" value="保存" id="btnSave" class="l-button l-button-submit" />
    <input type="submit" value="再添" id="Submit1" class="l-button l-button-submit" />
    <input type="button" value="撤销" id="btnCancel" class="l-button l-button-test" />
    </form>
    <div style="display: none">
        <!--  数据统计代码 -->
    </div>
</body>
</html>
